<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>项目评级-欢迎页</title>
<link href="__PUBLIC__/admin/css/style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="__PUBLIC__/admin/js/jquery.js"></script>

<link href="__PUBLIC__/admin/css/select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/admin/js/jquery.idTabs.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/select-ui.min.js"></script>

<link href="__PUBLIC__/validform/Validform.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/validform/Validform_v5.3.2.js"></script>
<script type="text/javascript" src="__PUBLIC__/validform/Validform_Datatype.js"></script>

<link rel="stylesheet" href="__PUBLIC__/kindeditor/themes/default/default.css" />
<script type="text/javascript" src="__PUBLIC__/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript" src="__PUBLIC__/kindeditor/lang/zh-CN.js"></script>

<script type="text/javascript">
var editor,editor1;
KindEditor.ready(function(K) {
	editor = K.create('textarea[id="item_content"]', {
		uploadJson : '{:U('kindeditor/upload_json',array('dir'=>image))}',
		fileManagerJson : '{:U('kindeditor/file_manager_json')}',
		items : ['fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline','removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist','insertunorderedlist', '|', 'emoticons', 'image', 'link'],
		allowFileManager : true,
		urlType : 'domain',
		afterCreate : function() {
			this.sync(); 
		},
		afterBlur:function(){ 
			this.sync(); 
		}
	});

	editor1 = K.create('textarea[id="com_content"]', {
		uploadJson : '{:U('kindeditor/upload_json',array('dir'=>image))}',
		fileManagerJson : '{:U('kindeditor/file_manager_json')}',
		items : ['fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline','removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist','insertunorderedlist', '|', 'emoticons', 'image', 'link'],
		allowFileManager : true,
		urlType : 'domain',
		afterCreate : function() {
			this.sync(); 
		},
		afterBlur:function(){ 
			this.sync(); 
		}
	});

	var uploadbutton = K.uploadbutton({
		button : K('#uploadButton')[0],
		fieldName : 'imgFile',
		url : '{:U('kindeditor/upload_json',array('dir'=>image))}',
		afterUpload : function(data) {
			if (data.error === 0) {
				var url = K.formatUrl(data.url, 'domain');
				K('#com_licence').val(url);
			} else {
				alert(data.message);
			}
		},
		afterError : function(str) {
			alert('自定义错误信息: ' + str);
		}
	});
	uploadbutton.fileBox.change(function(e) {
		uploadbutton.submit();
	});
});
$(document).ready(function(e) {
    $("#indus_id,#item_province,#item_city").uedSelect({
		width : 150			  
	});
});

function showcity(province){
	$("#item_city").empty();
	if(province.length>0){
		$("#item_city").append("<option value='' selected>请选择市</option>");
		$("#item_city").prev().find(".uew-select-text").html("请选择市");
		$.getJSON("{:U('itemrate/getcity')}&province="+province,function(result){
			var data=result.data;
			$.each(data, function(i, v){
				$("#item_city").append("<option value='"+v['city']+"'>"+v['city']+"</option>");
			});
		});
	}
}
</script>
</head>

<body>

	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><a href="{:U('index/welcome')}">首页</a></li>
			<li><a href="{:U('itemrate/index')}">项目评级</a></li>
		</ul>
    </div>
    
    <div class="formbody">
		<div class="formtitle"><span>项目评级（项目信息）</span></div>
		<form name="myform" id="myform" action="{:U('itemrate/index')}" method="post">
			<ul class="forminfo">
				<li><label>项目名称</label><input name="info[item_name]" id="item_name" type="text" class="dfinput" datatype="*5-30" errormsg="项目名称范围在5~30位之间！" maxlength="50" /><i class="Validform_checktip"></i></li>
				<li><label>行业分类</label>
					<div class="vocation">
						<select id="indus_id" name="info[indus_id]" datatype="*" errormsg="行业分类不能为空！">
							<option value="" selected>请选择行业分类</option>
							<volist name="indusinfo" id="data" key="key">
							<option value="{$data.indus_id}" <if condition="$data.childnum gt 0">disabled</if>>{$data.indus_title}</option>
								<if condition="$data.childnum gt 0">
									<volist name="data.child" id="child" key="keyc">
									<option value="{$child.indus_id}">--{$child.indus_title}</option>
									</volist>
								</if>
							</volist>
						</select>
					</div>
					<i class="Validform_checktip"></i>
				</li>
				<li><label>地域信息</label>
					<div class="vocation">
						<select id="item_province" name="info[item_province]" datatype="*" errormsg="省不能为空！" onchange="showcity(this.value);">
							<option value="" selected>请选择省</option>
							<volist name="provinces" id="data" key="key">
							<option value="{$data.province}">{$data.province}</option>
							</volist>
						</select>
					</div>
					<div class="vocation" style="padding-left:10px;">
						<select id="item_city" name="info[item_city]" datatype="*" errormsg="市不能为空！">
							<option value="">请选择市</option>
						</select>
					</div>
					<i class="Validform_checktip"></i>
				</li>
				<li><label>公司名称</label><input name="info[item_company]" id="item_company" type="text" class="dfinput" datatype="*"  errormsg="公司名称不能为空！" maxlength="50" /><i class="Validform_checktip"></i></li>
				<li><label>成立时间</label><input name="info[com_foundtime]" id="com_foundtime" type="text" class="dfinput" datatype="*"  errormsg="公司成立时间不能为空！" maxlength="20" /><i class="Validform_checktip"></i></li>
				<li><label>营业执照</label><input name="info[com_licence]" id="com_licence" type="text" class="dfinput" value="" readonly/>&nbsp;<input type="button" id="uploadButton" value="上传" /><i class="Validform_checktip"></i></li>
				<li><label>公司地址</label><input name="info[item_address]" id="item_address" type="text" class="dfinput" datatype="*" errormsg="公司地址不能为空！" maxlength="100" /><i class="Validform_checktip"></i></li>
				<li><label>公司网址</label><input name="info[com_weburl]" id="com_weburl" type="text" class="dfinput" datatype="url" errormsg="公司网址不能为空！" maxlength="100" /><i class="Validform_checktip"></i></li>
				<li><label>公司简介</label><textarea name="info[com_content]" id="com_content" cols="" rows="" class="textinput" style="height: 200px;width:700px;"></textarea></li>
				<li><label>股权比例</label><textarea name="info[com_ownership]" id="com_ownership" cols="" rows="" class="textinput" style="height: 50px;" datatype="*" errormsg="股权比例不能为空！" maxlength="200"></textarea><i class="Validform_checktip"></i></li>
				<li><label>公司其他</label><textarea name="info[com_remarks]" id="com_remarks" cols="" rows="" class="textinput" style="height: 50px;" datatype="/^\s*$/|*" errormsg="公司其他不能为空！" maxlength="200"></textarea><i class="Validform_checktip"></i></li>


				<li><label>联系人</label><input name="info[item_linkmen]" id="item_linkmen" type="text" class="dfinput" datatype="*2-10" errormsg="联系人在2~10位之间！" maxlength="20" /><i class="Validform_checktip"></i></li>
				<li><label>联系电话</label><input name="info[item_linkphone]" id="item_linkphone" type="text" class="dfinput" datatype="*,m"  errormsg="联系电话不能为空或格式不正确" maxlength="phone|mobile" maxlength="30" /><i class="Validform_checktip"></i></li>
				<li><label>项目简介</label><textarea name="info[item_content]" id="item_content" cols="" rows="" class="textinput" style="height: 200px;width:700px;"></textarea></li>

				<li><label>&nbsp;</label><input name="loginbtn" type="submit" class="btn" value="确认保存"/></li>
			</ul>
		</form>
    
    </div>

	<script>
	$(function(){
		$("#myform").Validform({
			//tiptype:2
			tiptype:function(msg,o,cssctl){
				var objtip=o.obj.siblings(".Validform_checktip");
				cssctl(objtip,o.type);
				objtip.text(msg);
			}
		});
	}); 
	</script>
</body>

</html>
